/**
 * Copyright(c) by JNet Smartware Group.
 * All rights reserved. Not distribution or redistribution without
 * any permission of JNet Smartware Group.
 * 
 * @author thuc
 * 2010/03/15
 */
package vn.smartware.co.java.net.commons;

import java.util.ArrayList;
import java.util.Collections;

/**
 * SortUtil
 * @author Thuc
 */
@SuppressWarnings({"rawtypes","unchecked"})
public class SortUtil {

	/**
	 * ASCENDING
	 */
	public static final int ASC = 1;
	
	/**
	 * DESCENDING
	 */
	public static final int DESC = 2;
	
	/**
	 * sort an arraylist of object
	 * @param list
	 * @param fields 
	 * @param orderby
	 */
	public static void sort(ArrayList list, String[] fields, int orderby) {
	
		Collections.sort(list, new ComparatorImpl(fields, orderby));
	}
	
	
}
